
	<div class="page-header">
		<h1><?php echo $page_title; ?></h1>
	</div>
	
	<?php if(!empty($category->description)): ?>
	<div class="row">
		<div class="span12"><?php echo $category->description; ?></div>
	</div>
	<?php endif; ?>
	
	
	<?php if((!isset($subcategories) || count($subcategories)==0) && (count($products) == 0)):?>
		<div class="alert alert-info">
			<a class="close" data-dismiss="alert">×</a>
			<?php echo lang('no_products');?>
		</div>
	<?php endif;?>
	
	
	
	<div class="row">

				
				<aside class="span3">

						<?php 
						$sub_category=false;
						if($category->parent_id)$sub_category=true;
						if(isset($this->categories[$category->id]) ) $parent_id_cat=$category->id;
						else {
								$parent_id_cat=$category->parent_id;
								$sub_category=false;
						}
						
						if(isset($this->categories[$parent_id_cat]) && count($this->categories[$parent_id_cat]) > 0):?>
					<div class="categories">
						<div class="titleHeader clearfix">
							<h3>Categories</h3>
						</div><!--end titleHeader-->
						
							<ul class="unstyled">
						<?php 
								foreach($this->categories[$parent_id_cat] as $cat):
									$parent_url=$active='';
								 
									if(isset($this->categories[0][$cat->parent_id])){
										$parent_url=$this->categories[0][$cat->parent_id]->slug;
}
									if($category->id==$cat->id)$active='active';
						?>
							<li><a class="invarseColor <?php echo $active?>" href="<?php echo site_url($parent_url.'/'.$cat->slug); ?>"><?php echo $cat->name;?></a>
							
							<?php 
							
							if($sub_category and isset($this->categories[$cat->parent_id]) && count($this->categories[$cat->parent_id]) > 0): ?>
								<ul class="submenu">
							<?php foreach($this->categories[$cat->parent_id] as $subcategory):
										$parent_url=$active='';
							
										if(isset($this->categories[0][$cat->parent_id]))
											$parent_url=$this->categories[0][$cat->parent_id]->slug;
										if($subcategory->id==$category->id) $active='active';
							?>
								<li><a class="invarseColor <?php echo $active?>" href="<?php echo site_url($parent_url.'/'.$subcategory->slug); ?>"><?php echo $subcategory->name;?></a></li>
							<?php endforeach;?>
								</ul>
							<?php 
							endif;?>
								
							</li>
						<?php endforeach;?>
						</ul>
					</div><!--end categories-->
						<?php 
						endif;
						?>
						
					<!--
					<div class="pro-range-slider">
						<div class="titleHeader clearfix">
							<h3>Shop By Price</h3>
						</div>
						<div class="price-range">
							<p class="clearfix">
							  <label>Price:</label>
							  <input type="text" id="amount">
							</p>
							<div id="slider-range"></div>
						</div>
					</div>end pro-range-slider
					-->

				<?php if(isset($special)):?>
					<div class="special">
						<div class="titleHeader clearfix">
							<h3>Specialités</h3>
						</div><!--end titleHeader-->

						<ul class="vProductItemsTiny">
						
						
						<?php foreach ($special as $product):?>
							<li class="span4 clearfix">
								<div class="thumbImage">
									<a href="<?php echo base_url('images/thumbnails/'.$product->slug)?>">
										<img src="<?php echo base_url('images/thumbnails/'.$product->images)?>" alt="<?php echo $product->seo_title?>" style="max-width: 92px; max-height: 92px"/>
									</a>
								</div>
								<div class="thumbSetting">
									<div class="thumbTitle">
										<a href="#" class="invarseColor">
											<?php echo $product->name?>
										</a>
									</div>
									<div class="thumbPrice">
										<span>
											<span class="strike-through"><?php echo $product->price>0?format_currency($product->price):''?></span> 
											<?php echo format_currency($product->saleprice)?>
										</span>
									</div>
										<?php if(is_array($product->category_slug)){ ?>
										<a href="<?php echo site_url(implode('/', $product->category_slug)); ?>" class="invarseColor">
											<?php echo $product->category_name?>
										</a>
										<?php }
										else echo $product->category_name;
										?>
										
								</div>
							</li>
							<?php endforeach;?>
							
						</ul>
					</div><!--end special-->
				<?php endif;?>
				</aside><!--end aside-->

				<div class="span9">

					<div class="productFilter clearfix">
					<form action="<?php echo site_url(uri_string());?>" method="get" id="filter_category">
						<div class="sortBy inline pull-left">
						Sort By
							<select id="sort_products" onchange="$('#filter_category').submit();" name="by">
								<option value=''><?php echo lang('default');?></option>
								<option<?php echo(!empty($_GET['by']) && $_GET['by']=='name-asc')?' selected="selected"':'';?> value="name-asc"><?php echo lang('sort_by_name_asc');?></option>
								<option<?php echo(!empty($_GET['by']) && $_GET['by']=='name-desc')?' selected="selected"':'';?>  value="name-desc"><?php echo lang('sort_by_name_desc');?></option>
								<option<?php echo(!empty($_GET['by']) && $_GET['by']=='price-asc')?' selected="selected"':'';?>  value="price-asc"><?php echo lang('sort_by_price_asc');?></option>
								<option<?php echo(!empty($_GET['by']) && $_GET['by']=='price-desc')?' selected="selected"':'';?>  value="price-desc"><?php echo lang('sort_by_price_desc');?></option>
							</select>
						
						</div>

						<div class="showItem inline pull-left">
							Show
							<select name="show"  id="showItem" onchange="$('#filter_category').submit();">
							<?php foreach (range(15, 100, 15) as $show) {?>

								<option<?php echo(!empty($_GET['show']) && $_GET['show']==$show)?' selected="selected"':'';?>  value="<?php echo $show?>"><?php echo $show?></option>
								<?php }?>
							</select>
						</div><!--end sortBy-->
					
						<div class="displaytBy inline pull-right">
							Display
							<div class="btn-group">
								<button class="btn btn-primary active"><i class="icon-th"></i></button>
								<button class="btn"><i class="icon-list"></i></button>
							</div>
						</div><!--end displaytBy-->
					</form>
					</div><!--end productFilter-->


					<div class="row">
					
			<?php if(count($products) > 0):?>
				<ul class="hProductItems clearfix">
				<?php foreach($products as $product):
				?>
					<li class="span3 clearfix">
						<?php
						$photo	= theme_img('no_picture.png', lang('no_image_available'));
						if($product->primary_photo)
							$photo	= '<img src="'.base_url('images/thumbnails/'.$product->primary_photo).'" alt="'.$product->seo_title.'"/>';
						?>
						<div class="thumbnail">
							<a href="<?php echo site_url(implode('/', $base_url).'/'.$product->slug); ?>">
								<?php echo $photo; ?>
							</a>
						</div>
						<div class="thumbSetting">
							<div class="thumbTitle">
								<a  class="invarseColor" href="<?php echo site_url(implode('/', $base_url).'/'.$product->slug); ?>"><?php echo $product->name;?></a>
							</div>
							<div class="thumbPrice">
								<span>
									<span class="strike-through"><?php echo $product->price>0?format_currency($product->price):''?></span> 
									<?php echo format_currency($product->saleprice)?>
								</span>
								<button class="btn btn-primary btn-small pull-right" data-title="+To Cart" data-placement="top" rel="tooltip">
									<i class="icon-shopping-cart"></i>
								</button>
							</div>

						</div>
						
				
					</li>
				<?php endforeach?>
				</ul>
			<?php endif;?>
			
					</div><!--end row-->

					<div class="pagination pagination-right">
						<?php echo $this->pagination->create_links();?>
					</div><!--end pagination-->

				</div><!--end span9-->

			</div>
			